import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect: '/layout/home',
    },
    {
      path: '/layout',
      component: () => import('../views/Layout.vue'),
      children:[
        {
          path: '/layout/home',
          meta:{title:'首页',icon:''},
          component: () => import('../views/Home.vue'),
        },
        {
          path: '/layout/ranking',
          meta:{title:'排行榜',icon:''},
          component: () => import('../views/Ranking.vue'),
        },
        {
          path: '/layout/my',
          meta:{title:'我的',icon:''},
          component: () => import('../views/My.vue'),
        }
      ]
    }
  ]
})

export default router
